import { ApiProperty } from '@nestjs/swagger';
import { Column, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Good } from '../../good/assets/good.entity';
import { Seat } from '../../seat/assets/seat.entity';
import { Order } from '../../order/assets/order.entity';

@Entity('ordervirtualdetail')
export class OrderVirtualDetail {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  @ApiProperty({ description: '虚拟商品总计时间' })
  virtualTime: number;

  @ManyToOne(() => Good)
  @ApiProperty({ description: '物品', type: () => Good })
  @JoinColumn()
  good: Good;

  @ApiProperty({ description: '座位', type: () => Seat })
  @ManyToOne(() => Seat)
  @JoinColumn()
  seat: Seat;

  @OneToOne(() => Order)
  @ApiProperty({ description: '订单', type: () => Order })
  @JoinColumn()
  order: Order;
}
